package com.ruoyi.project.medicinal.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.medicinal.domain.StockPurchase;
import com.ruoyi.project.medicinal.service.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/med/pur")
public class PurchaseController extends BaseController {

    @Autowired
    private PurchaseService purchaseService;

    /**
     * 获取采购列表
     */
    @PreAuthorize("@ss.hasPermi('med:pur:list')")
    @GetMapping("/list")
    public TableDataInfo list(StockPurchase purchase) {
        startPage();
        List<StockPurchase> list = purchaseService.selectProvList(purchase);
        return getDataTable(list);
    }


}
